DEFINITION MODULE VMetafile;

(*
VDI Metafile Functions.

UK __DATE__ __TIME__
*)

(*DEF_SWITCHES*)

FROM VDI    IMPORT XY,Integer,Point;
FROM PORTAB IMPORT ANYBYTE,SIGNEDWORD,UNSIGNEDWORD,ANYWORD;

TYPE MetaHdr = RECORD
                 MFHeader : SIGNEDWORD; (* -1 *)
                 MFHeadLen: UNSIGNEDWORD;
                 MFVersion: UNSIGNEDWORD;
                 MFNDCRCFl: UNSIGNEDWORD;
                 MFExtents: ARRAY[0..3] OF XY;
                 MFPageSiz: ARRAY[0..1] OF UNSIGNEDWORD;
                 MFCoords : ARRAY[0..3] OF XY;
#if linear
#if fill_byte
                 FillByte: ANYBYTE;
#endif
#endif
                 MFImgFlag: BOOLEAN;
#if intel
#if fill_byte
                 FillByte: ANYBYTE;
#endif
#endif
                 MFResvd  : ARRAY[0..8] OF ANYWORD;
               END;

(* [V]DI: Update [Meta]file [Extents] **************************************)

PROCEDURE VMetaExtents(Handle: UNSIGNEDWORD;
                       MinX  : XY;
                       MinY  : XY;
                       MaxX  : XY;
                       MaxY  : XY);

(* [V]DI: [Write] [Meta]file Item ******************************************)

CONST StartGroup = 10;
      EndGroup   = 11;

      BezQual = 32;

      NoLineStyle = 49;

      Shadow   = 50;
      NoShadow = 51;

      StartArea = 80;
      EndArea   = 81;

      VerApp = 101;

      MetaColor = 102;

PROCEDURE VWriteMeta(    Handle  : UNSIGNEDWORD;
                         NumIntIn: UNSIGNEDWORD;
                     VAR MyIntIn : ARRAY OF Integer;
                         NumPtsIn: UNSIGNEDWORD;
                     VAR MyPtsIn : ARRAY OF Point);

(* [V]DI: [M]etafile Physical [Page] [Size] ********************************)

PROCEDURE VMPageSize(Handle  : UNSIGNEDWORD;
                     PgWidth : UNSIGNEDWORD;
                     PgHeight: UNSIGNEDWORD);

(* [V]DI: [M]etafile [Coord]inate[s] Window ********************************)

PROCEDURE VMCoords(Handle: UNSIGNEDWORD;
                   X1    : XY;
                   Y1    : XY;
                   X2    : XY;
                   Y2    : XY);

(* [V]DI: [M]etafile Change GEM VDI [File] [Name] **************************)

PROCEDURE VMFileName(    Handle: UNSIGNEDWORD;
                     VAR Name  : ARRAY OF CHAR);

END VMetafile.
